import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '卡号',
    align:"center",
    dataIndex: 'cardNumber'
   },
   {
    title: '持卡人',
    align:"center",
    dataIndex: 'patientId_dictText'
   },
   {
    title: '卡类型',
    align:"center",
    dataIndex: 'cardType_dictText'
   },
   {
    title: '卡状态',
    align:"center",
    dataIndex: 'cardStatus_dictText'
   },
   {
    title: '余额',
    align:"center",
    dataIndex: 'balance'
   },
   {
    title: '手机号',
    align:"center",
    dataIndex: 'phone'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '卡号',
    field: 'cardNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入卡号!'},
          ];
     },
  },
  {
    label: '持卡人',
    field: 'patientId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"pat_basic_info,patient_name,id"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入持卡人!'},
          ];
     },
  },
  {
    label: '密码',
    field: 'cardPassword',
    component: 'InputPassword',
  },
  {
    label: '卡类型',
    field: 'cardType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zoe_card_type"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入卡类型!'},
          ];
     },
  },
  {
    label: '卡状态',
    field: 'cardStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zoe_card_status"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入卡状态!'},
          ];
     },
  },
  {
    label: '余额',
    field: 'balance',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入余额!'},
          ];
     },
  },
  {
    label: '手机号',
    field: 'phone',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
